package com.charging.service.impl;

import com.charging.dao.ChargingRecordDao;
import com.charging.entity.ChargingRecord;
import com.charging.service.RecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class RecordServiceImpl implements RecordService {

    @Resource
    private ChargingRecordDao chargingRecordDao;

    @Override
    public ChargingRecord getRecordById(Integer id) {
        return chargingRecordDao.getRecordById(id);
    }

    @Override
    public List<ChargingRecord> getAllRecords() {
        return chargingRecordDao.getAllRecords();
    }

    @Override
    public boolean addRecord(ChargingRecord record) {
        return chargingRecordDao.insert(record);
    }

    @Override
    public boolean updateRecord(ChargingRecord record) {
        return false;
    }

    @Override
    public boolean deleteRecord(Integer id) {
        return false;
    }

    @Override
    public List<ChargingRecord> findRecordsByPage(int page, int pageSize) {
        return Collections.emptyList();
    }

    @Override
    public int findRecordCount() {
        return 0;
    }

    @Override
    public List<ChargingRecord> getRecordsByUser(Integer userId) {
        return Collections.emptyList();
    }

    @Override
    public boolean startCharging(Integer userId, Integer pileId) {
        return false;
    }

    @Override
    public boolean stopCharging(Integer recordId) {
        return false;
    }

    @Override
    public BigDecimal calculateFee(Integer recordId) {
        return null;
    }

    @Override
    public List<ChargingRecord> getRecordsByPile(Integer pileId) {
        return Collections.emptyList();
    }

    @Override
    public Map<String, Integer> getWeeklyRecordStats() {
        return Collections.emptyMap();
    }

    @Override
    public long findRecordEnergyCount(){
        return chargingRecordDao.RecordEnergyCount();
    }
}
